home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Auge 4000 / Auge 4000 #47 (1990-06-22)(Amiga User Gruppe Einzugsgebiet 4000).zip / Auge 4000 #47 (1990-06-22)(Amiga User Gruppe Einzugsgebiet 4000).adf / arp-pro1.3 / NEW_MANUAL / PatternMatch_ADDENDUM < prev    next >
Text File  |  1990-06-22  |  3KB  |  99 lines

  1.  
  2.  
  3.  
  4.      PatternMatch(39.0)      ARP Programmers Manual    PatternMatch(39.0)
  5.  
  6.  
  7.  
  8.      ADDENDUM FOR
  9.       PatternMatch - perform a wildcard match on a string
  10.  
  11.      FUNCTION
  12.       The PatternMatch() wildcard characters have been changed in
  13.       the V39.0 (V1.3 of ARP) release.  Two of the unimplemented
  14.       wildcard characters specified in the earlier ARP releases
  15.       have been removed, and one new wildcard character has been
  16.       implemented.
  17.  
  18.       Gone are the {} bracket characters, which were previously
  19.       reserved for use as tags for a replace function.  These
  20.       characters had been translated to wildcard tokens in prior
  21.       releases, which caused problems with some commercial software
  22.       packages that used the bracket characters (notably Word
  23.       Perfect).  The new implementation resolves this collision.
  24.  
  25.       Also gone is the character class NOT construct, which was
  26.       specified by the characters [^].  Character classes are now
  27.       properly implemented using [] bracket characters, but the NOT
  28.       character class construct is gone.
  29.  
  30.       Instead of the NOT character class, there is a generalized
  31.       NOT operator, specified with the TILDE character ~.  When
  32.       the NOT operator is specified, any pattern following the
  33.       NOT character must NOT be matched in order to return "true".
  34.       This is most useful for specifying something like "All files
  35.       that do NOT end in .info", which can be represented by:
  36.  
  37.           ~*.info
  38.  
  39.       A caution in the current implementation of NOT, users should
  40.       be aware that any TILDE character is translated to a NOT
  41.       token, and thus attempting to specify a literal TILDE
  42.       character must be escaped.  This is a particular issue for
  43.       users of MicroEmacs, which creates files that end in a tilde
  44.       character.  For instance, if you use the command:
  45.       
  46.           >1 Delete *~
  47.  
  48.       That will delete ALL files, rather than deleting all files
  49.       that end with the TILDE character.  That is because the NOT
  50.       operator requires a non-match on any following pattern.  In
  51.       order to actually delete all files ending in TILDE, you must
  52.       use:
  53.  
  54.         1> Delete *'~
  55.  
  56.       This command uses the wildcard pattern ESCAPE character (the
  57.       single quote) to force the TILDE to be interpreted literally.
  58.       
  59.       A future implementation of the wildcard specs is likely to
  60.       have two changes from the V39 arp.library implementation.
  61.  
  62.  
  63.      Page 1                        (printed 10/16/89)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      PatternMatch(39.0)      ARP Programmers Manual    PatternMatch(39.0)
  71.  
  72.  
  73.  
  74.       The first change will be to limit the scope of the NOT
  75.       operator, such that it will have the same scope as the #
  76.       "Match zero or more instances of the following substring"
  77.       operator.  Thus, the NOT operator would match "Exactly zero
  78.       instances of the following substring".  Substrings are
  79.       grouped as either the following character, or the following
  80.       wildcard token (such as a character class, or an OR clause).
  81.  
  82.       The second change will be to interpret a trailing TILDE
  83.       character literally, since there is no following pattern to
  84.       match.  This is intended to resolve the collision with the
  85.       TILDE character in MicroEmacs.
  86.  
  87.       These possible enhancements have been mentioned here to
  88.       assist applications developers who may want to use the NOT
  89.       operator within their applications programs.  In particular,
  90.       it would be advisable to use:
  91.  
  92.         ~(*.info)
  93.  
  94.       instead of:
  95.       
  96.           ~*.info
  97.  
  98.       if you want to use the NOT operator for wildcard patterns.
  99.